import 'package:gameplay_flutter/generated/json/base/json_convert_content.dart';
import 'package:gameplay_flutter/lib_basemodel/discover/upload_video_res_entity.dart';

UploadVideoResEntity $UploadVideoResEntityFromJson(Map<String, dynamic> json) {
  final UploadVideoResEntity uploadVideoResEntity = UploadVideoResEntity();
  final String? playAuth = jsonConvert.convert<String>(json['playAuth']);
  if (playAuth != null) {
    uploadVideoResEntity.playAuth = playAuth;
  }
  final String? videoId = jsonConvert.convert<String>(json['videoId']);
  if (videoId != null) {
    uploadVideoResEntity.videoId = videoId;
  }
  final String? snapUrl = jsonConvert.convert<String>(json['snapUrl']);
  if (snapUrl != null) {
    uploadVideoResEntity.snapUrl = snapUrl;
  }
  final String? gifUrl = jsonConvert.convert<String>(json['gifUrl']);
  if (gifUrl != null) {
    uploadVideoResEntity.gifUrl = gifUrl;
  }
  final String? url = jsonConvert.convert<String>(json['url']);
  if (url != null) {
    uploadVideoResEntity.url = url;
  }
  final int? duration = jsonConvert.convert<int>(json['duration']);
  if (duration != null) {
    uploadVideoResEntity.duration = duration;
  }
  final int? width = jsonConvert.convert<int>(json['width']);
  if (width != null) {
    uploadVideoResEntity.width = width;
  }
  final int? height = jsonConvert.convert<int>(json['height']);
  if (height != null) {
    uploadVideoResEntity.height = height;
  }
  return uploadVideoResEntity;
}

Map<String, dynamic> $UploadVideoResEntityToJson(UploadVideoResEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['playAuth'] = entity.playAuth;
  data['videoId'] = entity.videoId;
  data['snapUrl'] = entity.snapUrl;
  data['gifUrl'] = entity.gifUrl;
  data['url'] = entity.url;
  data['duration'] = entity.duration;
  data['width'] = entity.width;
  data['height'] = entity.height;
  return data;
}

extension UploadVideoResEntityExtension on UploadVideoResEntity {
  UploadVideoResEntity copyWith({
    String? playAuth,
    String? videoId,
    String? snapUrl,
    String? gifUrl,
    String? url,
    int? duration,
    int? width,
    int? height,
  }) {
    return UploadVideoResEntity()
      ..playAuth = playAuth ?? this.playAuth
      ..videoId = videoId ?? this.videoId
      ..snapUrl = snapUrl ?? this.snapUrl
      ..gifUrl = gifUrl ?? this.gifUrl
      ..url = url ?? this.url
      ..duration = duration ?? this.duration
      ..width = width ?? this.width
      ..height = height ?? this.height;
  }
}